package com.ruoyi.house_sale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house_sale.mapper.EarnestmoneyMapper;
import com.ruoyi.house_sale.domain.Earnestmoney;
import com.ruoyi.house_sale.service.IEarnestmoneyService;

import javax.annotation.Resource;

/**
 * 诚意金管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-01
 */
@Service
public class EarnestmoneyServiceImpl implements IEarnestmoneyService 
{
    @Resource
    private EarnestmoneyMapper earnestmoneyMapper;

    /**
     * 查询诚意金管理
     * 
     * @param earnestid 诚意金管理主键
     * @return 诚意金管理
     */
    @Override
    public Earnestmoney selectEarnestmoneyByEarnestid(Long earnestid)
    {
        return earnestmoneyMapper.selectEarnestmoneyByEarnestid(earnestid);
    }

    /**
     * 查询诚意金管理列表
     * 
     * @param earnestmoney 诚意金管理
     * @return 诚意金管理
     */
    @Override
    public List<Earnestmoney> selectEarnestmoneyList(Earnestmoney earnestmoney)
    {
        return earnestmoneyMapper.selectEarnestmoneyList(earnestmoney);
    }

    /**
     * 新增诚意金管理
     * 
     * @param earnestmoney 诚意金管理
     * @return 结果
     */
    @Override
    public int insertEarnestmoney(Earnestmoney earnestmoney)
    {
        return earnestmoneyMapper.insertEarnestmoney(earnestmoney);
    }

    /**
     * 修改诚意金管理
     * 
     * @param earnestmoney 诚意金管理
     * @return 结果
     */
    @Override
    public int updateEarnestmoney(Earnestmoney earnestmoney)
    {
        return earnestmoneyMapper.updateEarnestmoney(earnestmoney);
    }

    /**
     * 批量删除诚意金管理
     * 
     * @param earnestids 需要删除的诚意金管理主键
     * @return 结果
     */
    @Override
    public int deleteEarnestmoneyByEarnestids(Long[] earnestids)
    {
        return earnestmoneyMapper.deleteEarnestmoneyByEarnestids(earnestids);
    }

    /**
     * 删除诚意金管理信息
     * 
     * @param earnestid 诚意金管理主键
     * @return 结果
     */
    @Override
    public int deleteEarnestmoneyByEarnestid(Long earnestid)
    {
        return earnestmoneyMapper.deleteEarnestmoneyByEarnestid(earnestid);
    }

    @Override
    public List<Earnestmoney> selectEarnestmoneyByBuyId(Long buyid) {
        return earnestmoneyMapper.selectEarnestmoneyByBuyId(buyid);
    }

    @Override
    public int toContract(Earnestmoney earnestmoney) {
        return earnestmoneyMapper.toContract(earnestmoney);
    }

    @Override
    public int beInvalid(Earnestmoney earnestmoney) {
        return earnestmoneyMapper.beInvalid(earnestmoney);
    }


}
